// 定义mutations
const mutations = {
  SET_SIGNAL_STATUS(state, status) {
    state.signal_status = status
  },
  SET_IDENTIFIER_CODE(state, code) {
    state.identifier_code = code
  }
}

// 定义actions
const actions = {
  setSignalStatus({ commit }, status) {
    commit('SET_SIGNAL_STATUS', status)
  },
  setIdentifierCode({ commit }, code) {
    commit('SET_IDENTIFIER_CODE', code)
  }
}

// 定义module
const app = {
  // 用了命名空间 store.dispatch('模块名/action函数名')
  // 获取state就要 store.state.app.xx (store.state.模块名.状态)
  namespaced: true,
  state: {
    signal_status: -1,
    identifier_code: ''
  },
  mutations,
  actions
}

export default app
